package com.hmall.order.interceptor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

/**
 * 把拦截器放入环境中
 */
@Configuration
public class MvcConfig extends WebMvcConfigurationSupport {
    @Autowired
    private MvcInterceptor mvcInterceptor;

    @Override
    protected void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(mvcInterceptor);
    }
}
